
export default {
  // 为当前模块开启命名空间
  namespaced: true,
  
  state: () => ({
		// 页面相关
		tabbar: [
			{
				pagePath: '/pages/index/index',
				iconPath: "/static/tabbar/index.png",
				selectedIconPath: "/static/tabbar/index_select.png",
				text: '首页',
				customIcon: false,
			},
			{
				pagePath: '/pages/merchant/merchant',
				iconPath: "/static/tabbar/merchant.png",
				selectedIconPath: "/static/tabbar/merchant_select.png",
				text: '商家',
				customIcon: false,
			},
			{
				pagePath: '/pages/publish/publish',
				iconPath: "/static/tabbar/publish.png",
				selectedIconPath: "/static/tabbar/publish_select.png",
				text: '发布',
				midButton: true,
				customIcon: false,
			},
			{
				pagePath: '/pages/message/message',
				iconPath: "/static/tabbar/message.png",
				selectedIconPath: "/static/tabbar/message_select.png",
				text: '消息',
				count: 0,
				customIcon: false,
			},
			{
				pagePath: '/pages/mine/mine',
				iconPath: "/static/tabbar/mine.png",
				selectedIconPath: "/static/tabbar/mine_select.png",
				text: '我的',
				count: 0,
				customIcon: false,
			},
		],
		
		beforeChangeTabPage: '', // 切换tabbar前的页面
		
		publishCates: [], // 发布话题分类列表
  }),
  
  mutations: {
		// 更新切换tabbar前的页面路径
		updateBeforeChangeTab(state, value) {
			state.beforeChangeTabPage = value
		},
		
		// 更新角标数
		updateTabbarBadge(state, value) {
			state.tabbar[value.index].count = value.count
		},
		
		// 更新发布话题分类列表
		updatePublishCates(state, value) {
			state.publishCates = value
		}
	},
  
  getters: {}
}